<script setup>
import QRCode from 'qrcode'


onMounted(() => {
  QRCode.toCanvas(document.getElementById('qrcode-app'), "https://a.app.qq.com/o/simple.jsp?pkgname=com.yquestion.zzwx", {
    width: 300,
    height: 300,
    color: {
      dark: '#000000', // 黑色
      light: '#ffffff' // 白色
    }
  }, function (error) {
    if (error) console.error(error);
    console.log('QR code generated successfully!');
  });
});


function init() {
}

init()
</script>

<template>
  <div class="Business-container">

    <div class="content1-container">
      <img src="@/assets/images/纸飞机.svg" class="">
      <span>联系我们</span>
    </div>
    <div class="content2-container">
      <img
          src="https://restapi.amap.com/v3/staticmap?location=106.556713,29.538326&zoom=13&size=750*300&markers=mid,,A:106.556713,29.538326&key=9bac6b12fe1c28a6a534fd7775e03212">
    </div>
    <div class="content3-container">
      <div class="content1-container">
        <img src="@/assets/images/纸飞机.svg" class="">
        <span>合作方式</span>
      </div>
      <div class="box1">
        <div class="box2">
          <div class="content-container">
            <canvas id="qrcode-app"></canvas>
            <span>扫码添加微信</span>
          </div>
        </div>

      </div>
    </div>
  </div>
</template>

<style scoped>
@media screen and (min-width: 1400px) {
  .Business-container {
    width: 1400px;
  }
  .content1-container{
    width: 1400px;
  }
}
.Business-container {
  margin: 0 auto;
  padding-bottom: 32px;
}

.content-container {
  width: 800px;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  flex-direction: column;
}

.content1-container {
  display: flex;
  height: 68px;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  color: #333;
  font-size: 24px;
  font-style: normal;
  font-weight: 700;
  line-height: 32px;
  background: white;
}

.content1-container img {
  width: 35px;
  height: 35px;
  flex-shrink: 0;
}

.content2-container {
  height: 446px;
  flex-shrink: 0;

}

.content2-container img {
  width: 100%;
  height: 100%;
}

.content3-container {
  margin-top: 32px;
  background: white;
}

.box1 {
  padding: 50px;
}
.box2{
  padding: 20px;
  border-radius: 12px;
  background: url('@/assets/images/app_background.png');
  background-size: cover;
}
</style>